#define  _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
int fun(int* p, int len)
{
	int l =0;
	int r = len - 1;
	int tmp = 0;
	while (l < r)
	{
		while (l < r && p[r] % 2 !=0 )
		{
			r--;
		}
		while (l < r && p[l] % 2 !=1)
		{
			l++;
		}
		if (l < r)
		{
			tmp = p[r];
			p[r] = p[l];
			p[l] = tmp;
		}
	}
}
int main()
{
	int arr[] = { 1,2,3,4,9,5,6,8,7,9,4,56 };
	int len = sizeof(arr) / sizeof(arr[0]);
	fun(arr,len);
	for (int i = 0; i < len; i++)
	{
		printf("%d  ", arr[i]);
	}
	return 0;
}